package com.hbnu.exercise.thread;

public class ThreadDemoTest
{
    public static void main(String[] args)
    {
        // 1.线程创建方法一：继承Thread类
//        ThreadDemo01 threadDemo = new ThreadDemo01();  创建线程对象
//        threadDemo.start();  启动线程

        // 2.线程创建方法二：实现Runnable接口
//        ThreadDemo02 threadDemo = new ThreadDemo02();
//        Thread thread = new Thread(threadDemo);
//        thread.start();

//        new Thread(() -> {
//            for (int i = 0; i < 100; i++)
//                System.out.println("sub thread" + i);
//        }).start();

        PrintEvenThread evenThread = new PrintEvenThread();
        PrintOddThread oddThread = new PrintOddThread();

        evenThread.start();
        oddThread.start();
    }
}
